﻿<!DOCTYPE html>
<html>
<head>
	<title>@ViewBag.Title</title>
	<link href="@Url.Content( "~/Content/Site.css" )" rel="stylesheet" type="text/css" />
	<script src="@Url.Content( "~/Scripts/jquery-1.7.1.min.js" )" type="text/javascript"></script>
	<script src="@Url.Content( "~/Scripts/jquery.unobtrusive-ajax.min.js" )" type="text/javascript"></script>

	<script type="text/javascript">
		$(document).ready(function () {

			$(".teavchSitempWriter").each(function () {

					var container = this;
					var wr = container.getAttribute("WebsiteRoot");
					var cu = container.getAttribute("CrawlUrl");
					var se = container.getAttribute("SearchEngine");
					var urlToStart = container.innerHTML;
					if (wr != '' && wr != 'undefined'
						&& cu != null && cu != 'undefined' && cu != '') {
						$.post("http://localhost:61847/Home/GenerateSitemap", { WebsiteRoot: wr, CrawlUrl: cu, SearchEngine: se },
								function (obj) {
									container.innerHTML = obj; //set the rating attribute
								}
						);
					}
					else {
						container.innerHTML = "No source code found in container"; //set the rating attribute
					}

				});

		})
	</script>

</head>
<body>
	<div class="page">
		<div id="header">
			<div id="title">
				<h1>My Sitemap Generator!</h1>
			</div>
			<div id="logindisplay">
				@Html.Partial( "_LogOnPartial" )
			</div>
			<div id="menucontainer">
				<ul id="menu">
					<li>@Html.ActionLink( "Home", "Index", "Home" )</li>
					<li>@Html.ActionLink( "About", "About", "Home" )</li>
					<li>@Html.ActionLink( "Sitemap", "GenerateSitemap", "Home" )</li>
				</ul>
			</div>
		</div>
		<div id="main">
			@RenderBody()
		</div>
		<div id="footer">
		</div>
	</div>
</body>
</html>
